﻿@using VirtualPress.Infrastructure.Entities.Entity
@{
    ViewBag.Title = "PublishApplyEdit";
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
@section head{
<link href="/Content/css/unicorn.main.css" rel="Stylesheet" />
}
<div id="content-header">
    <h1>
        图书出版申请编辑</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/press/index" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a href="/WorkSpace/Press/Books">
        管理后台</a> <a href="/WorkSpace/Press/Books">图书管理</a> <a class="current">图书出版申请编辑</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-book"></i></span>
                    <h5>
                        图书出版申请编辑</h5>
                </div>
                @{
                    PublishApply item = ViewBag.Data;
                    if(item != null)
                    {
                <div class="widget-content nopadding">
                    <form id="form" class="form-horizontal" method="post" 
                    action="/workspace/press/PublishApplyEdit">
                    <input type="hidden" name="id" value="@item.Id" />
                    <div class="control-group">
                        <label class="control-label">
                            书 名</label>
                        <div class="controls">
                            <input type="text" name="name" class="span6 {required:true}"
                             value="@item.Name" 
                             placeholder="图书名称" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            作 者</label>
                        <div class="controls">
                            <input type="text" name="authors" class="span6 {required:true}" 
                            value="@item.Authors"
                            placeholder="作者" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            领 域</label>
                        <div class="controls">
                            <input type="text" name="field" class="span6 {required:true}" 
                            value="@item.Field"
                            placeholder="专著、教材、教辅、作品、诗歌、小说、书画等" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            出书方式</label>
                        <div class="controls">
                            <select class="span6" name="Way">
                                <option value="0">出版社独资出书</option>
                                <option value="1">出版社合作出书</option>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            联系人</label>
                        <div class="controls">
                            <input type="text" name="contact" class="span6 {required:true}"
                            value="@item.Contact" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            联系电话</label>
                        <div class="controls">
                            <input type="text" name="phone" class="span6 {required:true}" 
                             value="@item.Phone" placeholder="联系电话" />
                            <span class="help-block">请确保我们能通过此方式联系到您</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            联系邮箱</label>
                        <div class="controls">
                            <input type="text" name="mail" class="span6 {required:true,email:true}" 
                            value="@item.Mail" placeholder="example@mail.com" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            图书介绍</label>
                        <div class="controls ">
                            <textarea class="span6 {required:true}" name="introduction" rows="5" placeholder="书籍简要介绍">@item.Introduction</textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="controls">
                            <span class="text-info">我们将在收到您的申请后尽快与您取得联系！</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="controls">
                            <input type="submit" class="btn btn-primary btn-large" value="提交" />
                        </div>
                    </div>
                    </form>
                </div>
                    }
                    }
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript" src="/scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/scripts/jquery.metadata.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likbook').addClass('active open');
            $('select[name="Way"]').val(@item.Way);
            $('#form').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                }
            });
        });
    </script>
}
